package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
public class Praise extends BaseDomain {

    private Long userId; //用户id

    private Long typeId;//类型id

    private Integer state;//状态  是否点赞

    private Integer type;//类型   攻略 游记  游记内容

    private Integer reader;//是否阅读

    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date praiseDate;//点赞时间


    /*被点赞的人*/
    private User receiver;
    /*点赞的人*/
    private User doer;
    /*被点赞的游记或评论*/
    private TravelOrComment travelOrComment;

    /*点赞类型*/
    public String getTypeName() {
        String name = "";
        if (type == 3) {
            name = "游记";
        } else if (type == 4) {
            name = "评论";
        }
        return name;
    }

}